package cn.house.dao;

import org.hibernate.Query;

import cn.house.entity.User;
import util.HibernateUtil;

public class UserDaoImpl implements UserDao{

	@Override
	public User login(String name, String password) {
		Query query = HibernateUtil.currentSession()
				.createQuery("from User where name = ? and password = ?");
		query.setParameter(0, name).setParameter(1, password);
		return (User) query.uniqueResult();
	}

}
